package com.example.designpatterns.chain;

/**
 * CriticalHandler类 - 处理CRITICAL类型的请求
 */
public class CriticalHandler extends Handler {
    
    public CriticalHandler() {
        super("严重错误处理器");
    }
    
    @Override
    protected boolean canHandle(Request request) {
        return request.getType() == Request.RequestType.CRITICAL;
    }
    
    @Override
    protected void doHandle(Request request) {
        System.out.println("严重错误处理器处理请求: " + request.getMessage());
        System.out.println("严重错误已记录，触发最高级别警报，通知所有相关人员和管理层");
        System.out.println("启动应急响应流程，自动执行故障恢复措施");
        request.setHandled(true);
    }
} 